using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using TVT.UI.EventArguments;
using TVT.UI.Helpers;
using TVT.Common.Helpers;

namespace TVT.UI
{
    public partial class Users : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if ((!Page.IsPostBack) && (Roles.IsUserInRole(WellKnownKeys.GuestRolKey)))
            {
                UserList.Visible = false;
            }
            UserList.OnEditUser += new EventHandler(UserList_OnEditUser);
            UserList.OnDeletedUser += new EventHandler(UserList_OnDeletedUser);
        }

        private void UserList_OnEditUser(object souce, EventArgs e)
        {
            UserEventArgs args = (UserEventArgs)e;
            UserEntry.EditUser(args.IdUser);         
        }
        private void UserList_OnDeletedUser(object souce, EventArgs e)
        {
            UserEntry.Cancel();
        }
        
    }
}
